package com.smartHire.service.impl;

import com.smartHire.dao.BusinessDao;
import com.smartHire.domain.Business;
import com.smartHire.service.BusinessService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.jsp.tagext.TryCatchFinally;
import java.util.List;

@Service("businessService")
public class BusinessServiceImpl implements BusinessService {
    @Resource(name = "businessDao")
    private BusinessDao businessDao;

    public void setBusinessDao(BusinessDao businessDao) {
        this.businessDao = businessDao;
    }


    @Override
    public int addBusiness(Business business) {

        try {
            int nums = businessDao.inserBusiness(business);
            return nums;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<Business> querybusiness() {
        try {
            List<Business> businesses = businessDao.selectBusiness();
            return businesses;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }
}
